package org.note.law.module.law;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.lboot.jpa.entity.BaseEntity;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

@EqualsAndHashCode(callSuper = true)
@Data
@Entity
@Table(name = "law_code")
@ApiModel(value = "法典",description = "法典")
@EntityListeners(AuditingEntityListener.class)
@AllArgsConstructor
@NoArgsConstructor
public class LawCode extends BaseEntity implements Serializable {
    public LawCode(String id,
                   String codeCover,
                   String codeName,
                   String codeDesc,
                   String codeVersion,
                   String createUserId,
                   String modifyUserId,
                   Date createdTime,
                   Date updatedTime){
        this.id = id;
        this.codeCover = codeCover;
        this.codeName = codeName;
        this.codeDesc = codeDesc;
        this.codeVersion = codeVersion;
        this.createUserId = createUserId;
        this.modifyUserId = modifyUserId;
        this.createdTime = createdTime;
        this.updatedTime = updatedTime;
    }

    @ApiModelProperty(value = "法典封面")
    @Column(name = "code_cover")
    String codeCover;

    @ApiModelProperty(value = "法典名称")
    @Column(name = "code_name")
    String codeName;

    @ApiModelProperty(value = "法典介绍")
    @Column(name = "code_desc",length = 1024)
    String codeDesc;

    // 只填写年限 2024
    @ApiModelProperty(value = "法典版本")
    @Column(name = "code_version")
    String codeVersion;

    @ApiModelProperty(value = "法典内容")
    @Column(name = "content", columnDefinition = "LONGTEXT")
    String content;

}
